<?php
$this->pageTitle = 'Zoznam odmien';
?>

<div class="listing">
	<h3>Zoznam odmien</h3>
	<?php echo '<p style="font-size: 56px;">SPOLU: ' . number_format($totalCommissionValue, 2, ',', ' ') . ' &euro;</p>'; ?>
	<?php if ($markets): ?>
		<table class="list">
			<thead>
				<tr>
					<th class="identifier"><?php echo 'ID'; ?></th>
					<th><?php echo 'Popis'; ?></th>
					<th class="col50"><?php echo 'Typ'; ?></th>
					<th class="col100"><?php echo 'Odmena (&euro;)'; ?></th>
				</tr>
			</thead>
			<tbody>
				<?php
				foreach ($markets as $market):
				?>
				<tr>
					<td class="number">
						<?php echo $market['Market']['id']; ?>
					</td>
					<td>
						<?php echo htmlspecialchars($market['Market']['description']); ?>
					</td>
					<td>
						<?php echo ($market['Market']['type'] == 1 ? 'dopyt' : 'ponuka'); ?>
					</td>
					<td class="number">
						<?php
							if ($market['Market']['status'] == Market::STATUS_IN_PROCESS) {
								echo number_format($personType['PersonType']['commission_2_tipsters'] * $market['Market']['commission'] / 100, 2, ',', ' ');
							} elseif ($market['Market']['status'] == Market::STATUS_FINISHED_SUCCESSFULLY) {
								echo number_format($myCommissions[$market['Market']['type']][$market['Market']['id']], 2, ',', ' ');
							} else {
								echo '-';
							}
						?>
					</td>
				</tr>
				<?php endforeach; ?>
			</tbody>
		</table>
	<?php endif; ?>
</div>